<div class="row">
    <!-- Observable details information-->
    <div class="col-md-6">
        <h4 class="vpad10 text-primary">
            Basic Information
            <div class="task-actions pull-right">
                <!-- <span if-permission="manageShare" allowed="{{userPermissions}}"> -->
                <span>
                    <a href ng-click="scrollTo('#observable-sharings')">
                        <span class="mr-xxs action-button">
                            <i class="fa fa-users"></i> Sharing
                        </span>
                    </a>
                </span>

                <span class="ml-xxs action-button" if-permission="manageAction" allowed="{{userPermissions}}" ng-if="appConfig.connectors.cortex.enabled">
                    <a href class="text-primary noline nowrap" ng-click="getObsResponders(artifact, true)">
                        <i class="text-primary fa fa-cog"></i>
                        Responders
                    </a>
                </span>
            </div>
        </h4>
        <dl class="dl-horizontal clear">
            <dt class="pull-left">TLP</dt>
            <dd ng-if="canEdit">
                <a class="noline" href ng-init="activeTlp = 'static'" ng-click="activeTlp = 'active'">
                    <tlp value="artifact.tlp" format="activeTlp" on-update="updateField('tlp', newValue)"></tlp>
                </a>
            </dd>
            <dd ng-if="!canEdit">
                <tlp format="'static'" value="artifact.tlp"></tlp>
            </dd>
        </dl>

        <dl class="dl-horizontal clear" ng-if="artifact.attachment && artifact.attachment.hashes">
            <dt class="pull-left">Hash</dt>
            <dd>
                <div ng-repeat="hash in artifact.attachment.hashes" class="wrap" marked="hash | hashType"></div>
            </dd>
        </dl>

        <dl class="dl-horizontal clear" ng-show="artifact.metadata.size">
            <dt class="pull-left">Size</dt>
            <dd>{{artifact.attachment.size}} bytes</dd>
        </dl>

        <dl class="dl-horizontal clear">
            <dt class="pull-left">Date added</dt>
            <dd>{{artifact.startDate | shortDate}}</dd>
        </dl>

        <dl class="dl-horizontal clear">
            <dt class="pull-left">Is IOC</dt>
            <dd ng-if="canEdit">
                <span class="clickable" ng-click="updateField('ioc', !artifact.ioc)">
                    <i class="text-primary fa" ng-class="{'true': 'fa-star', 'false': 'fa-star-o'}[artifact.ioc]"></i>
				</span>
            </dd>
            <dd ng-if="!canEdit">
                <span>
                    <i class="text-primary fa" ng-class="{'true': 'fa-star', 'false': 'fa-star-o'}[artifact.ioc]"></i>
				</span>
            </dd>
        </dl>

        <dl class="dl-horizontal clear">
            <dt class="pull-left">Has been sighted</dt>
            <dd ng-if="canEdit">
                <span class="clickable" ng-click="updateField('sighted', !artifact.sighted)">
                    <i class="text-primary fa" ng-class="{'true': 'fa-toggle-on', 'false': 'fa-toggle-off'}[artifact.sighted]"></i>
                </span>
            </dd>
            <dd ng-if="!canEdit">
                <span>
                    <i class="text-primary fa" ng-class="{'true': 'fa-toggle-on', 'false': 'fa-toggle-off'}[artifact.sighted]"></i>
				</span>
            </dd>
        </dl>

        <dl class="dl-horizontal clear">
            <dt class="pull-left">Ignored for similarity</dt>
            <dd ng-if="canEdit">
                <span class="clickable" ng-click="updateField('ignoreSimilarity', !!!artifact.ignoreSimilarity)">
                    <i class="text-primary fa" ng-class="{'true': 'fa-chain-broken', 'false': 'fa-chain'}[!!artifact.ignoreSimilarity]"></i>
                </span>
            </dd>
            <dd ng-if="!canEdit">
                <span>
                    <i class="text-primary fa" ng-class="{'true': 'fa-chain-broken', 'false': 'fa-chain'}[!!artifact.ignoreSimilarity]"></i>
				</span>
            </dd>
        </dl>

        <dl class="dl-horizontal">
            <dt class="pull-left">Tags</dt>
            <dd ng-if="canEdit">
                <updatable-tag-list on-update="updateField('tags', getLabels(newValue))" value="artifact.tags" source="getTags"></updatable-tag-list>
            </dd>
            <dd ng-if="!canEdit">
                <tag-list ng-if="artifact.tags.length > 0" data="artifact.tags"></tag-list>
                <em ng-if="!artifact.tags || artifact.tags.length === 0" class="text-warning">Not Specified</em>
            </dd>
        </dl>

        <dl class="dl-horizontal clear">
            <dt class="pull-left">Description</dt>
            <dd ng-if="canEdit">
                <updatable-text value="artifact.message" on-update="updateField('message', newValue)" placeholder="Artifact description"></updatable-text>
            </dd>
            <dd ng-if="!canEdit">
                <div ng-if="artifact.message" marked="artifact.message" class="markdown"></div>
                <em ng-if="!artifact.message" class="text-warning">Not Specified</em>
            </dd>
        </dl>
    </div>
    <!-- Observable links -->
    <div class="col-md-6" ng-if="!!!artifact.ignoreSimilarity">
        <h4 class="vpad10 text-primary">Links</h4>

        <div class="empty-message" ng-if="similarArtifacts.length === 0">
            This observable has not been seen in any other case
        </div>

        <div ng-if="similarArtifacts.length > 0">
            <strong>Observable seen in {{similarArtifacts.length}} other case(s)</strong>
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th width="80">Flags</th>
                        <th>Case</th>
                        <th width="120">Date added</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="a in similarArtifacts | limitTo:similarArtifactsLimit" style="cursor: pointer;" ng-click="openArtifact(a)" uib-tooltip="{{a.message}}" tooltip-popup-delay="500" tooltip-placement="bottom">
                        <td>
                            <observable-flags observable="a" inline="true" hide-seen="true" hide-similarity="true"></observable-flags>
                        </td>
                        <td>
                          <!-- [{{a.dataType}}]: {{a.data || a.attachment.name}}<br> -->
                          #{{a.stats.case.caseId}} - {{a.stats.case.title}}
                        </td>
                        <td>{{a.startDate | shortDate}}</td>
                    </tr>
                </tbody>
            </table>
            <div class="mt-xxs text-center" ng-if="similarArtifactsLimit < similarArtifacts.length">
                <a href ng-click="showMoreSimilar()"><i class="fa fa-angle-down"></i> Show more</a>
            </div>
        </div>

    </div>
</div>
